from likeshop_api_project.api.login_api import login_model
from likeshop_api_project.base.mybase import Tools


# 获取订单列表
class get_order_model(Tools):
    path = '/api/order/lists'

    def get_order_action(self, type, hd):
        get_order_data = {
            "type": type
        }
        get_order = self.huihua.get(url=self.hosturl+self.path, params=get_order_data, headers=hd)
        return get_order.json()


if __name__ == '__main__':
    import requests

    s = requests.session()
    reg = login_model(huihua=s)
    msg = reg.login_action(account="13356786546", password="rr98765", client=2)
    # print(msg)
    get_token = msg["data"]["token"]
    # print(get_token)
    hd = {"token": get_token}

    get_order = get_order_model(huihua=s)
    msg = get_order.get_order_action(type=all, hd=hd)
    print(msg)
